﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace CSEPT.Controllers
{
    public class IndexController : Controller
    {
        //
        // GET: /Index/

        public ActionResult Index()
        {
            Models.EventViewModel EVM = new Models.EventViewModel();
          
            return MainIndex(EVM);
        }

        public ActionResult IndexInfo(string Message, string Type)
        {
            Models.EventViewModel EVM = new Models.EventViewModel();
            EVM.PageMessage = Message;
            EVM.PageMessageType = Type;
            return MainIndex(EVM);
        }
        private ActionResult MainIndex(Models.EventViewModel EVM){
            EVM.Events = EVM.dal.GetEvents();
            return View("Index", EVM);
        }
    }
}
